﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Pipes;

namespace TTIServer.IPC
{

	public enum Direction
	{
	
		In,
		Out
		
	}

	public enum Type
	{
		Settings,
		Heartbeat
	}

	public class NamedPipeMessage
	{

		public Direction dirMessage;
		public Type msgType;
		public object Data;
		
	}

	class NamedPipeInterface
	{

		NamedPipeServerStream pipeServer = new NamedPipeServerStream("TTICommPipe", PipeDirection.InOut, TTIServerClass.MaxTablets);


		//Event Delegate
		public delegate void NamedPipeReadEventHandler(object sender, NamedPipeMessage msg);


		//Event Handler
		private NamedPipeReadEventHandler TTI_NPREH;

		public event NamedPipeReadEventHandler NamedPipeOnRead
		{

			add		{ TTI_NPREH += value; }

			remove	{ TTI_NPREH -= value; }

		}

		//Read Method

		//Write Method



	}
}
